﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace DelimitedFile
{
    public partial class DelimOptions : Form
    {
        public List<string> Delimiters { get; set; }
        public bool IsTopHeader { get; set; }

        public DelimOptions()
        {
            InitializeComponent();
        }

        private void CmdOk_Click(object sender, EventArgs e)
        {
            GetDelimiters();
                IsTopHeader = ChkFirstLine.Checked;
                Close();
        }

        private void GetDelimiters()
        {
             Delimiters = new List<string>();

            if (ChkComma.Checked)
            {
                Delimiters.Add(ChkComma.Tag.ToString());
            }
            if (ChkPipe.Checked)
            {
                Delimiters.Add(ChkPipe.Tag.ToString());
            }
            if (ChkTabs.Checked)
            {
                Delimiters.Add("Tab");
            }
            if (ChkCustomDelim.Checked)
            {
                Delimiters.Add(TxtCustomeDelim.Text);
            }
        }

        private void CmdCancel_Click(object sender, EventArgs e)
        {
            Close();
        }
    }
}
